// require.ensure 是 Webpack 的特殊语法，用来设置 组件到底路径
/**
 * 1.定义路由，每个路由应该映射一个组件
 * path : 浏览器的显示的路径
 * name ： 路由的名字
 * component : 路由的组件路径
 */
import home from '../view/home.vue';
import main from '../view/main.vue';
const routes = [{
    // 发现
    path: '/main',
    name: 'main',
    component: main,
    children: [{
        path: '/',
        redirect: 'home'
    }, {
        path: 'home',
        name: 'home',
        component: home
    }, {
        path: 'found',
        name: 'found',
        component (resolve) {
            require(['../view/found.vue'], resolve);
        }
    }, {
        path: 'my',
        name: 'my',
        component (resolve) {
            require(['../view/me.vue'], resolve);
        }
    }]
}, {
    path: '/shopping',
    name: 'shopping',
    component (resolve) {
        require(['../view/page404.vue'], resolve);
    }
}, {
    path: '/scene',
    name: 'scene',
    component (resolve) {
        require(['../view/page404.vue'], resolve);
    }
}, {
  path: '*',
  redirect: 'main/home'
}];
export default routes;
